package org.xxpay.pay.channel.witbytespay;

import com.alibaba.fastjson.JSONObject;
import org.springframework.stereotype.Component;
import org.springframework.util.Assert;

/**
 * witbytes支付
 * @author: DX
 * @date: 2024年4月1日09:26:50
 */
@Component
public class WitbytespayConfig {
    public static final String CHANNEL_NAME = "witbytespay";
    public static final String CHANNEL_NAME_H5PAY = CHANNEL_NAME + "_h5pay";
    public static final String CHANNEL_NAME_WEBPAY = CHANNEL_NAME + "_webpay";
    public static final String CHANNEL_NAME_MINIPAY = CHANNEL_NAME + "_minipay";

    public static final String RETURN_VALUE_SUCCESS = "SUCCESS";
    public static final String RETURN_VALUE_ERROR = "FAILED";

    // 商户账号
    private String merchant_id;
    //链接秘钥
    private String secret;
    //支付类型
    private String paytool;
    // 请求地址
    private String reqUrl;

    public WitbytespayConfig(){}

    public WitbytespayConfig(String payParam) {
        Assert.notNull(payParam, "init "+ CHANNEL_NAME +" config error");
        JSONObject object = JSONObject.parseObject(payParam);
        this.merchant_id = object.getString("merchant_id");
        this.secret = object.getString("secret");
        this.paytool = object.getString("paytool");
        this.reqUrl = object.getString("reqUrl");
    }

    public String getMerchant_id() {
        return merchant_id;
    }

    public void setMerchant_id(String merchant_id) {
        this.merchant_id = merchant_id;
    }

    public String getSecret() {
        return secret;
    }

    public void setSecret(String secret) {
        this.secret = secret;
    }

    public String getPaytool() {
        return paytool;
    }

    public void setPaytool(String paytool) {
        this.paytool = paytool;
    }

    public String getReqUrl() {
        return reqUrl;
    }

    public void setReqUrl(String reqUrl) {
        this.reqUrl = reqUrl;
    }
}
